package com.eamois.action.manual;

import java.util.Collection;

import com.eamois.action.BaseAction;
import com.eamois.domain.manual.Catalog;
import com.eamois.domain.manual.CatalogStyle;
import com.eamois.domain.manual.CatalogStyleField;
import com.eamois.domain.manual.Technology;
import com.eamois.service.manual.CatalogService;
import com.eamois.service.manual.CatalogStyleFieldService;
import com.eamois.service.manual.CatalogStyleService;
import com.eamois.util.ServiceFactory;

public class CatalogAction extends BaseAction{
	private CatalogService catalogService;
	private CatalogStyleService catalogStyleService;
	private CatalogStyleFieldService catalogStyleFieldService;
	
	public CatalogAction() {
		setCatalogService((CatalogService) ServiceFactory.getInstance().getBean("catalogService"));
		setCatalogStyleService((CatalogStyleService) ServiceFactory.getInstance().getBean("catalogStyleService"));
		setCatalogStyleFieldService((CatalogStyleFieldService) ServiceFactory.getInstance().getBean("catalogStyleFieldService"));
	}
	
	public Collection<Catalog> findAllCatalog() {
		return this.getCatalogService().findAllCatalog();
	}
	public Collection<Catalog> findAllCatalogByTech(Technology tech) {
		return this.getCatalogService().findAllCatalogByTech(tech);
	}
	
	public Catalog findCatalogByType(String type){
		return this.getCatalogService().findCatalogByType(type);
	}
	
	public Catalog findCatalogByNameAndType(String name,String type){
		return this.getCatalogService().findCatalogByNameAndType(name, type);
	}
	
	public Catalog findCatalogByName(String name,Technology tech){
		return this.getCatalogService().findCatalogByName(name,tech);
	}
	
	public Collection<CatalogStyle> findCatalogStyle(Catalog catalog) {
		return this.getCatalogStyleService().findCatalogStyle(catalog);
	}
	
	public Collection<CatalogStyleField> findCatalogStyleField(CatalogStyle catalogStyle) {
		return this.getCatalogStyleFieldService().findCatalogStyleField(catalogStyle);
	}
	
	public void saveCatalog(Catalog catalog) {
		this.getCatalogService().save(catalog);
	}
	
	public void removeCatalog(Catalog catalog) {
		this.getCatalogService().remove(catalog);
	}
	
	public void saveCatalogStyle(CatalogStyle catalogStyle) {
		this.getCatalogStyleService().save(catalogStyle);
	}
	
	public void removeCatalogStyle(CatalogStyle catalogStyle) {
		this.getCatalogStyleService().remove(catalogStyle);
	}
	
	public void saveCatalogStyleField(CatalogStyleField catalogStyleField) {
		this.getCatalogStyleFieldService().save(catalogStyleField);
	}
	
	public void removeCatalogStyleField(CatalogStyleField catalogStyleField) {
		this.getCatalogStyleFieldService().remove(catalogStyleField);
	}

	public CatalogService getCatalogService() {
		return catalogService;
	}

	public void setCatalogService(CatalogService catalogService) {
		this.catalogService = catalogService;
	}

	public CatalogStyleService getCatalogStyleService() {
		return catalogStyleService;
	}
	
	public Collection<Catalog> findAllCatalogByName(String name){
		return this.getCatalogService().findAllCatalogByName(name);
	}

	public void setCatalogStyleService(CatalogStyleService catalogStyleService) {
		this.catalogStyleService = catalogStyleService;
	}

	public CatalogStyleFieldService getCatalogStyleFieldService() {
		return catalogStyleFieldService;
	}

	public void setCatalogStyleFieldService(CatalogStyleFieldService catalogStyleFieldService) {
		this.catalogStyleFieldService = catalogStyleFieldService;
	}
}
